﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.JShop.UI;
using System.Data;
using System.IO;

namespace CNVP.JShop.Web.Admin.CommonWindows
{
    public partial class ImgStore : AdminPage
    {
        public string PicName;
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("imgName");
            string path = Server.MapPath("../../UploadFile/File/");
            string[] strFiles = Directory.GetFiles(path, "*");
            foreach (string file in strFiles)
            {
                FileInfo fi = new FileInfo(file);
                PicName = fi.Name.Substring(1,fi.Name.LastIndexOf(".")-1);
                DataRow row = dt.NewRow();
                row["imgName"] = "../../UploadFile/File/" + fi.Name;
                dt.Rows.Add(row);
            }
            rpList.DataSource = dt;
            rpList.DataBind();
        }
    }
}